package com.rabbit.service.domain.repo;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.rabbit.service.domain.entity.GroupDataEntity;

public interface GroupDataRepo extends CrudRepository<GroupDataEntity, String>,JpaSpecificationExecutor<GroupDataEntity> , JpaRepository<GroupDataEntity, String> {

	@Query("select t from GroupDataEntity t where t.id = ?1 and t.date >= ?2 and t.date <= ?3 order by t.hour , t.timeGroup")
	List<GroupDataEntity> getListByIdAndTime(String id, String start, String end);
	
	@Query("select t from GroupDataEntity t where t.date >= ?1 and t.date <= ?2  order by t.hour , t.timeGroup")
	List<GroupDataEntity> getListByTime(String start, String end);

}
